const state = {
  appName: '',
  name: '',
  profileTables: [],
  templateInfo: {},
  apps: [],
  compareTables: [],
  newTemplate: {}
}

const mutations = {
  SET_APP_NAME(state, name) {
    state.appName = name
  },
  SET_APPS(state, apps) {
    state.apps = apps
  },
  INCREMENT_DEV_COUNT(state, id) {
    state.apps.find((_) => _.id === id).devCount++
  },
  DECREMENT_DEV_COUNT(state, id) {
    state.apps.find((_) => _.id === id).devCount--
  },
  SET_NAME(state, name) {
    state.name = name
  },
  SET_PROFILE_TABLES(state, tables) {
    state.profileTables = tables
  },
  SET_TEMPLATE_INFO(state, info) {
    state.templateInfo = info
  },
  SET_NEW_TEMPLATE(state, info) {
    state.newTemplate = info
  }
}

export default {
  namespaced: true,
  state,
  mutations

}
